package com.example.blueconn.activity;

import android.os.Bundle;

import androidx.annotation.Nullable;

import com.qmuiteam.qmui.arch.QMUIFragmentActivity;

public class BaseActivity extends QMUIFragmentActivity {

//    private QMUISkinManager.OnSkinChangeListener mOnSkinChangeListener = new QMUISkinManager.OnSkinChangeListener() {
//        @Override
//        public void onSkinChange(QMUISkinManager skinManager, int oldSkin, int newSkin) {
//            if (newSkin == SkinManager.SKIN_WHITE) {
//                QMUIStatusBarHelper.setStatusBarLightMode(BaseActivity.this);
//            } else {
//                QMUIStatusBarHelper.setStatusBarDarkMode(BaseActivity.this);
//            }
//        }
//    };

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        initData();
        initView();
        initListener();
    }

    //    @Override
//    public void onCreate(@Nullable Bundle savedInstanceState, @Nullable PersistableBundle persistentState) {
//        super.onCreate(savedInstanceState, persistentState);
//        QMUISkinManager skinManager = QMUISkinManager.defaultInstance(this);
//        setSkinManager(skinManager);
//        mOnSkinChangeListener.onSkinChange(skinManager, -1, skinManager.getCurrentSkin());
//
//        initView();
//        initData();
//        initListener();
//    }

    protected void initListener() {

    }

    protected void initData() {

    }

    protected void initView() {

    }

    @Override
    protected void onStart() {
        super.onStart();
//        if (getSkinManager() != null) {
//            getSkinManager().addSkinChangeListener(mOnSkinChangeListener);
//        }
    }

    @Override
    protected void onStop() {
        super.onStop();
//        if (getSkinManager() != null) {
//            getSkinManager().removeSkinChangeListener(mOnSkinChangeListener);
//        }
    }
}
